﻿<meta charset="utf-8">
<style>
	#choujiang{
		position:absolute;
		top:280px;
		left:90px;
	}
</style>
<div id="pic"></div>
<input type="button" value="抽奖" id="choujiang"/>
<script>
	var name=['<img src="古力娜扎.jpg"/>','<img src="炎亚纶.jpg"/>','<img src="张翰.jpg"/>'];
    pic.innerHTML=name[0];
    var timer;
    choujiang.onclick=function(){
    	if(choujiang.value=="停"){
    		clearInterval(timer);
    		choujiang.value="抽奖";
    	}else{
    		timer=setInterval(f,10);
    		choujiang.value="停";
    	}
    };
       function f(){
       	pic.innerHTML=
       	  name[Math.floor(Math.random()*name.length)];
       }
	
</script>
